package com.lmn.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {

    @PostMapping("order")
    public String order(@RequestBody Order order) {
        switch (order.getClass().getSimpleName()) {
            case "DiscountOrder":
                return "Discount Order";
            case "RegularOrder":
                return "Regular Order";
            default:
                return "Unknown Order";
        }
    }

}
